<template>
    <h2 style="text-align:left">loading {{loading}}</h2>
</template>

<script>
import { ref, onUnmounted } from 'vue'
export default {
    setup(){
        let loading = ref('')
        let i = 0
        let arr = ',.,..,...,....'.split(',')
        let timer = setInterval(() => {
            loading.value = arr[i]
            i = (i+1) % 5
        },350)
        onUnmounted(() => {
            clearInterval(timer)
        })
        return {loading}
    }
}
</script>